package com.hdd.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.TestService;

@Controller
public class TestController {

    /**
     * 不要在意这个报错，可以正常运行，
     * houdongdong
     * Could not autowire. No beans of 'TestService' type found. more...
     * */
    @Autowired
    private TestService testService;

    @RequestMapping("/test")
    @ResponseBody
    public  String test(){
        System.out.println(testService.getClass());
        System.out.println("1+1=2");
        return testService.getName();
    }
}
